package 设计模式.行为型.command命令.spingboot;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import 设计模式.行为型.command命令.spingboot.command.Command;
import 设计模式.行为型.command命令.spingboot.command.SwitchOffCommand;
import 设计模式.行为型.command命令.spingboot.command.SwitchOnCommand;

@Configuration
public class MultiBeanConf {

    @Bean(name = "lightOff")
    Command getSwitchOffCommand(@Autowired Light light){
        return new SwitchOffCommand(light);
    }

    @Bean(name = "lightOn")
    Command getSwitchOnCommand(@Autowired Light light){
        return new SwitchOnCommand(light);
    }

}
